/*
 * MainApplication.java
 *
 * Project: TECHWATCH - TESTING TECHNOLOGIES
 *
 * Copyright 2008 by ELCA Informatique SA
 * Av. de la Harpe 22-24, 1000 Lausanne 13
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of ELCA Informatique SA. ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license
 * agreement you entered into with ELCA.
 */

package ch.elca.training;

import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import ch.elca.training.service.impl.GroupServiceImpl;

public class MainApplication {
	
	private static final org.slf4j.Logger s_logger = LoggerFactory
			.getLogger(MainApplication.class);

	private static final String[] INCLUSIVE_CONFIG_LOCATIONS = {
			"classpath*:mandatory/*.xml", "classpath*:scenarios/db/raw/*.xml" };

	private static ApplicationContext s_applicationContext = null;

	private static void startup() {
		s_applicationContext = new ClassPathXmlApplicationContext(
				INCLUSIVE_CONFIG_LOCATIONS, true);
	}

	public static void main(String[] args) {
		s_logger.info("Starting up ...");
		startup();
		
		float startTime = System.currentTimeMillis();
		System.out.println(s_applicationContext.getBean(GroupServiceImpl.class).getAllWithMembers2());
		float endTime = System.currentTimeMillis();
		s_logger.info("Finished");
		System.out.println("Time : "+(endTime- startTime));
	}
}